<?php
    $this->title = "Cadastro de cursos";
    $this->headTitle($this->title);
?>
<p><a class="linkBtn" href="<?php echo $this->url(array('controller'=>'cursos','action'=>'add'));?>">Adicionar novo curso</a></p>
<table style="width:100%;">
    <tr>
        <th>Curso</th>
        <th>Status</th>
        <th>Responsável</th>
        <th>Data Início</th>
        <th>Data Conclusão</th>
        <th>&nbsp;</th>
    </tr>
<?php
    $cont = 0;
    foreach($this->cursos as $curso) :
        $cont++;
        if($cont % 2 == 0)
            echo '<tr class="even">';
        else
            echo '<tr class="odd">';
?>
        <td class="texto"><a href="<?php echo $this->url(array(
            'module'=>'default',
            'controller'=>'cursos',
            'action'=>'detalhe',
            'id'=>$this->escape($curso->id),
            ));?>"><?php echo $this->escape($curso->curso);?></a></td>
        <td class="texto"><?php echo $this->escape($curso->status);?></td>
        <td class="texto"><?php echo $this->escape($curso->responsavel);?></td>
        <td class="texto"><?php
                $data = new Zend_Date($curso->data_inicio,'yyyy-MM-dd');
                echo $data->toString('dd/MM/yyyy');
            ?></td>
        <td class="texto"><?php
                $data = new Zend_Date($curso->data_conclusao,'yyyy-MM-dd');
                echo $data->toString('dd/MM/yyyy');
            ?></td>
        <td>
        <a href="<?php echo $this->url(array('controller'=>'cursos','action'=>'edit', 'id'=>$curso->id));?>">
        <img alt="Editar"  src="<?php echo $this->baseUrl().'/images/edit.png'; ?>"></a>
        <a href="<?php echo $this->url(array('controller'=>'cursos','action'=>'delete', 'id'=>$curso->id));?>">
        <img alt="Apagar"  src="<?php echo $this->baseUrl().'/images/trash.png'; ?>"></a>
        </td>
<?php echo "</tr>"; endforeach; ?>
</table>
<br/>
<a class="linkBtn" href="<?php echo $this->url(array('controller'=>'index','action'=>'index'));?>">Voltar</a>
<br/>
